package com.base.support;

import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * 基础DAO
 *
 * @Author: wangxiaonan
 * @Date: 2018/8/12
 **/
public interface BaseDao<T, E, K> extends Serializable {

    int countByCriteria(E criteria);

    int deleteByCriteria(E criteria);

    int deleteByPrimaryKey(K key);

    int insert(T entity);

    int insertSelective(T entity);

    List<T> selectByCriteria(E criteria);

    T selectByPrimaryKey(K key);

    int updateByCriteriaSelective(@Param("record") T entity, @Param("criteria") E criteria);

    //int updateByCriteria(@Param("record") T entity, @Param("example") E criteria);

    int updateByPrimaryKeySelective(T entity);

    //int updateByPrimaryKey(T entity);
}
